package com.itheima.cosumer.controller;

import com.itheima.manager.pojo.User;
import com.itheima.manager.service.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController //声明返回值都是json类型
@RequestMapping("user")
public class ControllerImp {

    @Reference
    private UserService userService;
    @RequestMapping("findAll")
    public List<User> findAll(){

        return userService.list();
    }
    @RequestMapping("delete")
    public void userdelete(Integer id){
        System.out.println("id = " + id);
        boolean b = userService.removeById(id);
        System.out.println("b = " + b);
    }
}
